import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import App from '../App.vue'

// 个人中心 - 首页；
const mine = () => import('@/pages/mine/index')
// 个人中心 - 我的数据；
const myData = () => import('@/pages/mine/myData')
// 个人中心 - 我的消息；
const myMsg = () => import('@/pages/mine/myMsg')
// 个人中心 - 我的工具；
const myTool = () => import('@/pages/mine/myTool')
// 个人中心 - 我的钱包；
const myWallet = () => import('@/pages/mine/myWallet')
// 个人中心 - 我的更多；
const myMore = () => import('@/pages/mine/myMore')
// 个人中心 - 个人资料；
const myPersonalData = () => import('@/pages/personalData/index')
// 个人中心 - 编辑个人资料；
const myPersonalDataEdit = () => import('@/pages/personalData/edit')
// 个人中心 - 个人简介；
const myProfile = () => import('@/pages/personalData/myProfile')
// 个人中心 - 我的余额；
const myBalance = () => import('@/pages/myBalance/index')
// 个人中心 - 我的余额 - 余额账单；
const balanceBill = () => import('@/pages/myBalance/balanceBill')
// 个人中心 - 我的余额 - 联系客服；
const contactCustomer = () => import('@/pages/myBalance/contactCustomer')
// 个人中心 - 我的店铺；
const myStore = () => import('@/pages/myStore/index')
// 个人中心 - 我的订单 - 银发订单；
const grayHairOrder = () => import('@/pages/myOrder/grayHairOrder')
// 个人中心 - 我的认证；
const myCertification = () => import('@/pages/myCertification/index')
// 个人中心 - 实名认证；
const realName = () => import('@/pages/realName/index')
// 个人中心 - 用户协议；
const agreement = () => import('@/pages/agreement/index')
// 个人中心 - 确认登录；
const confirm = () => import('@/pages/confirm')
// 个人中心 - 举报；
const report = () => import('@/pages/report')
//广告系统
const advertisement = () => import('@/pages/advertisement')
//分享视频
const shareVideo = () => import('@/pages/shareVideo/index')
//我的更多——>更多
const myMorelist = () => import('@/pages/mine/myMorelist')

// 个人中心 - 上传背景；
const myBackground = () => import('@/pages/mine/myBackground')
// 下载app；
const download = () => import('@/pages/download/index')
//素材管理
const material = () => import('@/pages/material/index')
//添加素材
const addmaterial = () => import('@/pages/material/addmaterial')
//素材详情
const materialdetail = () => import('@/pages/material/materialdetail')
const routes = [
  {
    path: '/',
    component: App,
    children:[
      {
        path: '/',  // 默认进入路由
        redirect: 'mine'   //重定向'
      },
      // 首页
      {
        path: '/mine',
        name: 'mine',
        component: mine,
      },
      // 我的数据
      {
        path: '/myData',
        name: 'myData',
        component: myData,
      },
      // 我的消息
      {
        path: '/myMsg',
        name: 'myMsg',
        component: myMsg,
      },
      // 我的工具
      {
        path: '/myTool',
        name: 'myTool',
        component: myTool,
      },
      // 我的钱包
      {
        path: '/myWallet',
        name: 'myWallet',
        component: myWallet,
      },
      // 我的更多
      {
        path: '/myMore',
        name: 'myMore',
        component: myMore,
      },

      // 个人资料
      {
        path: '/myPersonalData',
        name: 'myPersonalData',
        component: myPersonalData,
        meta: {
          keepAlive: true
        }
      },
      // 编辑个人资料
      {
        path: '/myPersonalDataEdit',
        name: 'myPersonalDataEdit',
        component: myPersonalDataEdit,
        meta: {
          keepAlive: true
        }
      },

      // 我的个人简介
      {
        path: '/myProfile',
        name: 'myProfile',
        component: myProfile,
      },
      // 我的余额
      {
        path: '/myBalance',
        name: 'myBalance',
        component: myBalance,
      },
      // 余额账单
      {
        path: '/balanceBill',
        name: 'balanceBill',
        component: balanceBill,
      },
      // 联系客服
      {
        path: '/contactCustomer',
        name: 'contactCustomer',
        component: contactCustomer,
      },
      // 我的店铺
      {
        path: '/myStore',
        name: 'myStore',
        component: myStore,
      },

      // 银发订单
      {
        path: '/grayHairOrder',
        name: 'grayHairOrder',
        component: grayHairOrder,
      },
      // 我的认证
      {
        path: '/myCertification',
        name: 'myCertification',
        component: myCertification,
      },
      //实名认证
      {
        path: '/realName',
        name: 'realName',
        component: realName
      },
      //确认登录
      {
        path: '/confirm',
        name: 'confirm',
        component: confirm
      },
      //用户协议
      {
        path: '/agreement',
        name: 'agreement',
        component: agreement
      },
      //举报
      {
        path: '/report',
        name: 'report',
        component: report
      },
      //广告
      {
        path: '/advertisement',
        name: 'advertisement',
        component: advertisement
      },
      //分享视频
      {
        path: '/shareVideo',
        name: 'shareVideo',
        component: shareVideo
      },
      //上传背景
      {
        path: '/myBackground',
        name: 'myBackground',
        component: myBackground
      },
      //下载app
      {
        path: '/download',
        name: 'download',
        component: download,
        meta: {
          title:'下载幻美'
        }
      },
      //更多列表
      {
        path: '/myMorelist',
        name: 'myMorelist',
        component: myMorelist,
        meta: {
          title:'幻美视频'
        }
      },
      //素材管理
      {
        path: '/material',
        name: 'material',
        component: material,
        meta: {
          title:'素材管理'
        }
      },
      //添加素材
      {
        path: '/addmaterial',
        name: 'addmaterial',
        component: addmaterial,
        meta: {
          title:'添加素材'
        }
      },
      //素材详情
      {
        path: '/materialdetail',
        name: 'materialdetail',
        component: materialdetail,
        meta: {
          title:'素材详情'
        }
      }

    ]
  }
]
export default new Router({
  mode: 'history',
  routes
})
